package keni.html.android.framework.metadata;

import java.util.HashMap;
import java.util.Map;

import keni.html.android.framework.util.Constants;

import org.json.JSONException;
import org.json.JSONObject;



public class ElementBase {
	
	private Map<String, String> propertities=new HashMap<String, String>();
	
	void setPropertities(String name,String value)
	{
		propertities.put(name, value);
	}
	
	public Map<String, String> getProperities()
	{
		return propertities;
	}
	
	public String getElementId()
	{
		return propertities.get(Constants.MetadataTagName.HTMLELEMENTID);
	}
	
	JSONObject convertToJsonObject() throws JSONException
	{
		JSONObject jsonObject=new JSONObject();
		
		for (Map.Entry<String, String> entry : propertities.entrySet()) {
			jsonObject.put(entry.getKey(), entry.getValue());
		}
		
		return jsonObject;
	}

}
